﻿using ChuanYe.CountyFireManagement.EF.MySQL.Models;
using ChuanYe.CountyFireManagement.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ChuanYe.CountyFireManagement.BLL
{
    public class FireAlarmTypeBLL
    {
        #region 构造单例
        private FireAlarmTypeBLL() { }
        private static FireAlarmTypeBLL _instance;
        public static FireAlarmTypeBLL Instance
        {
            get
            {
                return _instance ?? (_instance = new FireAlarmTypeBLL());
            }
        }
        #endregion

        public List<FireAlarmTypeModel> Get()
        {
            using (CountyFireManagementContext ef = new CountyFireManagementContext())
            {
                return ef.Firealarmtype.OrderBy(o => o.Sort).ToList()
                         .Select(s => new FireAlarmTypeModel { Key = s.TypeId, Value = s.TypeName, Sort = s.Sort }).ToList();
            }
        }
    }
}
